import request from '@/utils/request'
// 区域列表
export const getAreaList = (params) => {
  return request({
    method: 'get',
    url: '/api/vm-service/region/search',
    params
  })
}
// 新增区域
export const sendAddArea = (data) => {
  return request({
    method: 'post',
    url: '/api/vm-service/region',
    data
  })
}
// 修改区域
export const sendChangeArea = (data, id) => {
  return request({
    method: 'put',
    url: `/api/vm-service/region/${id}`,
    data
  })
}
// 获取区域详情
export const getAreaDetails = (i, s, d) => {
  return request({
    method: 'get',
    url: `/api/vm-service/node/search?pageIndex=${i}&pageSize=${s}&regionId=${d}`
  })
}
// 删除区域
export const sendDelArea = (id) => {
  return request({
    method: 'DELETE',
    url: `/api/vm-service/region/${id}`
  })
}

// 合作商请求

// 获取合作商列表  /  发送合作商搜索请求
export const getPartnersList = (params) => {
  return request({
    method: 'get',
    url: '/api/user-service/partner/search',
    params
  })
}
// 删除合作商
export const sendDelPartner = (id) => {
  return request({
    method: 'DELETE',
    url: `/api/user-service/partner/${id}`
  })
}
// 新建合作商
export const sendAddPartner = (data) => {
  return request({
    method: 'post',
    url: '/api/user-service/partner',
    data
  })
}
// 修改合作商
export const sendChangePartner = (data, id) => {
  return request({
    method: 'put',
    url: `/api/user-service/partner/${id}`,
    data
  })
}
// 重置合作商密码
export const sendResetPasswords = (id) => {
  return request({
    method: 'put',
    url: `/api/user-service/partner/resetPwd/${id}`
  })
}
// 点位管理部分 请求

// 获取区域搜索选择框数据   请求数据写死
export const getAreaSearch = () => {
  return request({
    method: 'get',
    url: '/api/vm-service/region/search',
    params: {
      pageIndex: 1,
      pageSize: 10000
    }
  })
}

// 获取点位管理页面数据 点位搜索
export const getPointList = (params) => {
  return request({
    method: 'get',
    url: '/api/vm-service/node/search',
    params
  })
}
// 获取商圈列表
export const getBusinesstList = () => {
  return request({
    method: 'get',
    url: '/api/vm-service/businessType'
  })
}
// 获取归属合作商
export const getBelongingList = () => {
  return request({
    method: 'get',
    url: '/api/user-service/partner/search',
    params: {
      pageIndex: 1,
      pageSize: 10000
    }
  })
}
// 新增点位
export const sendAddPoint = (data) => {
  return request({
    method: 'post',
    url: '/api/vm-service/node',
    data
  })
}
// 删除点位
export const sendDelPoint = (id) => {
  return request({
    method: 'DELETE',
    url: `/api/vm-service/node/${id}`
  })
}
// 修改点位
export const sendChangePoint = (data, id) => {
  return request({
    method: 'put',
    url: `/api/vm-service/node/${id}`,
    data
  })
}
// 查看点位详情
export const sendLookPoint = (id) => {
  return request({
    method: 'get',
    url: `/api/vm-service/node/vmList/${id}`
  })
}
